

object Test0712 {

  def main(args: Array[String]): Unit = {

    val test =
      """
        |event_id: String = "",
        |event_time: Long = -1,
        |event_key: String = "",
        |event_type: String = "",
        |detail_id: String = "",
        |project: String = "",
        |customer_id: String = "",
        |direction: String = "",
        |classify: String = "",
        |source: String = "",
        |point: Double = -1,
        |begin_date: Long = -1,
        |end_date: Long = -1,
        |is_special: String = "",
        |product: String = "",
        |ref_order: String = "",
        |string1: String = "",
        |string2: String = "",
        |behavior_campaign: String = "",
        |bulk_campaign: String = "",
        |rule: String = "",
        |correlation_type: String = ""
        |""".stripMargin

    val strings: Array[String] = test.split(",")

    var i = 0
    for (str <- strings){
      i += 1
      val column = str.replace("\n", "").split(":")(0)
      val row = s"if (payment.$column != "
      println(row)
//      val row =
//        s"""    if (payment.$column != ""){
//           |      rowUpsert.addString("$column",payment.$column)
//           |    }
//           |""".stripMargin
      println(row)
//      println(column)
    }
    println(i)


  }
}
